
import paramiko
import logger as logger

log = logger.get_logger()
def get_ssh_client(hostname, port, username, password):
    log.info("remote hostname: %s" % hostname)
    log.info("remote port: %s" % port)
    log.info("remote username: %s" % username)
    log.info("remote password: %s" % password)
    log.info("ssh connecting................")
    client = paramiko.SSHClient()
    client.set_missing_host_key_policy(paramiko.AutoAddPolicy)
    client.connect(hostname, port, username, password, compress=True)
    log.info("ssh connect success")
    return client